home *** CD-ROM | disk | FTP | other *** search
-
- Welcome to the Wonderful World of Splines by Helene (Lee) Taran
-
- OVERVIEW:
-
- This program demonstrates various curve fitting and rendering
- techniques. The user chooses a sequence of points and a curve
- type, and the program generates and displays the appropriate
- curve. A simple <..well...it looks simple> interface allows
- the user to add, remove, and relocate points, in addition to
- selecting a curve type.
-
-
- Historical Note:
- This program was written for my third assignment in
- CS248A "Introduction to Computer Graphics" at Stanford.
- It is an honor code violation for anyone to submit this program
- for any class under any name other than my own.
-
- COMPILING:
-
- This program was compiled under Manx 3.30e using the +l option
- (...I was too lazy to figure out int lengths...). The makefile
- contains everything you need to put this mess together.
-
-
- INTERFACE:
-
- When the program is started, it fills the screen (wipes out the
- window title bar), and draws a spline through 3 control points.
-
- The program maintains a current sequence of control points and
- a current curve type. Whenever either is changed, the window is
- redrawn to show the the positions of the control points and
- the curve defined by them.
-
- To change the control points, the user presses the left mouse
- button near one of the control points. The program pops up
- a menu (right under the mouse position!) from which the user can
- choose one of:
-
- - Move this control point to a new location
- - Add a control point before this one
- - Add a control point after this one
- - Remove this control point
-
- To change the curve type, the user presses the mouse button
- elsewhere in the window. The program pops up a menu, from which
- the user can select a new curve type:
-
- - Open cubic bspline
- - Closed cubic bspline
- - Open natural cubic spline
- - Closed natural cubic spline
- - Open cubic bspline with triple knotted endpoints
-
- Addition Items in this menu:
-
- - Redraw the current curve
- - Draw/Erase the curve construction lines (AFrame)
- - Quit
-
-
- FILE DESCRIPTIONS:
-
- spline:
- The executable.
-
- popmenu.h, popmenu.c:
- These files implement all of the popup menu routines. To
- use the popup menu package, see popmenu.README
-
- spline.h, spline.c:
- Constant declarations and Main program, respectively. The
- main program basically just sleeps until the user does something
- (clicks a mouse button) and then calls ProcessCmd to determine
- what to do next.
-
- sprt.c:
- Sets up the environment. Contains routins to the necessary
- libraries, set up the screen, window, colors, popup menus
- that are being used. Also contains routines to close
- everything and signal fatal errors.
-
- bspline.c:
- Implements the three basic bspline drawing routines.
-
- bezier.h, bezier.c:
- These files implement a bezier curve render. The basic
- algorithm was outlined for us in CS248A.
-
- cmds.c:
- This file contains routines determine what's done when
- a user selects a particular item from a given menu.
-
- dlist.h, dlist.c:
- These files implement a general interface to doubly linked
- circular lists. Provides O(1) access to the first and
- last elements of the list, and O(1) access to the length
- of the list.
-
- interpl.c:
- Implements the interpolation and rendering of natural
- cubic splines (both open and closed). The rendering routines
- depend on the bspline drawing routines.
-
- BUGS : none known.
-